089c30817adcbfbcb726c7e47a17f1538b496577,opennms-rrd/opennms-rrd-jrobin/src/main/java/org/opennms/netmgt/rrd/jrobin/JRobinRrdStrategy.java,JRobinRrdStrategy,createGraphDef,#File#String[]#,388

Before Change


                String definition = arg.substring("DEF:".length());
                String[] def = splitDef(definition);
                String[] ds = def[0].split("=");
                File dsFile = new File(workDir, ds[1].replace("\\", ""));
                graphDef.datasource(ds[0], dsFile.getAbsolutePath(), def[1], def[2]);
                List<String> defBits = new ArrayList<String>();
                defBits.add(dsFile.getAbsolutePath());

After Change


                String[] def = splitDef(definition);
                String[] ds = def[0].split("=");
                // log().debug("ds = " + Arrays.toString(ds));
                final String replaced = ds[1].replaceAll("\\\\(.)", "$1");
                // log().debug("replaced = " + replaced);
                
                final File dsFile;
                File rawPathFile = new File(replaced);
                if (rawPathFile.isAbsolute()) {
                	dsFile = rawPathFile;
                } else {
                	dsFile = new File(workDir, replaced);
                }
                // log().debug("dsFile = " + dsFile + ", ds[1] = " + ds[1]);
                
                final String absolutePath = (File.separatorChar == '\\')? dsFile.getAbsolutePath().replace("\\", "\\\\") : dsFile.getAbsolutePath();
                // log().debug("absolutePath = " + absolutePath);
                graphDef.datasource(ds[0], absolutePath, def[1], def[2]);